package com.finance41.webtools.automerge;

import com.asual.lesscss.LessEngine;
import com.asual.lesscss.LessException;

/**
 * Extends the FileAutoMerger to merge and compile LESS files when modified.
 *
 * @author Ionut Bilica
 */
public class LessAutoCompiler extends FilesAutoMerger {

	private static final LessEngine LESS_COMPILER = new LessEngine();

	protected String process(String content) {
		String css;
		try {
			css = LESS_COMPILER.compile(content);
		} catch (LessException e) {
			css = e.getMessage();
			System.err.println(e.getMessage());
		}
		return css;
	}

}
